#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using pii = pair<int, int>;

const int MAXN = 1010;
const int MAXM = 110;
const int MAXK = 1e5 + 5;
const int MOD = 998244353;

int n, m, k, a[MAXM], u, v;
int c[MAXN];
ll dp[MAXK];

struct Edge {
    int to, next, w;
} e[MAXN << 1];

int head[MAXN], idx = 1;

void add_edge(int u, int v, int w) {
    e[idx].to = v;
    e[idx].next = head[u];
    e[idx].w = w;
    head[u] = idx++;
}
void clear_graph() {
    memset(head, -1, sizeof(head));
    memset(e, 0, sizeof(e));
    idx = 1;
}

bool dfs(int start, int end, int fa = -1) {
    if (start == end) return true;

    for (int i = head[start]; ~i; i = e[i].next) {
        int j = e[i].to, w = e[i].w;
        if (j != fa) {
            if (dfs(j, end, start)) {
                c[w]++;
                return true;
            }
        }
    }

    return false;
}

int main() {
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios::sync_with_stdio(false), cin.tie(0);
    cin >> n >> m >> k;
    for (int i = 1; i <= m; i++) cin >> a[i];

    clear_graph();
    for (int i = 1; i < n; i++) {
        cin >> u >> v;
        add_edge(u, v, i);
        add_edge(v, u, i);
    }

    for (int i = 1; i <= m - 1; i++) dfs(a[i], a[i + 1]);

    ll s = 0;
    for (int i = 1; i < n; i++) s += c[i];

    if (s + k < 0 || (s + k) % 2) {
        cout << 0 << endl;
        return 0;
    }

    dp[0] = 1;
    for (int i = 1; i <= n - 1; i++) {
        for (int j = 1e5; j >= c[i]; j--) {
            dp[j] = (dp[j] + dp[j - c[i]]) % MOD;
        }
    }

    cout << dp[(s + k) >> 1] << endl;
    return 0;
}